﻿using System.Xml.Linq;

namespace Wombat.Client.Core
{
    public interface IClientContextFactory
    {
        IClientContext Create(XDocument configuration);
    }

    public class ClientContextFactory : IClientContextFactory
    {
        public IClientContext Create(XDocument configuration)
        {
            var confLoader = new ClientConfigurationLoader();
            confLoader.LoadConfiguration(configuration);
            return new ClientContext(confLoader);
        }
    }
}
